package com.qfedu.edu.slot.impl;

import com.qfedu.edu.slot.generate.GenerateSlot;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.servlet.http.HttpServletRequest;

/**
 * 基于滑动时间窗口实现限流检测
 *
 * 限流检测
 */
@Component
@Slf4j
public class LimitSlot extends GenerateSlot {


    @Override
    public int getOrder() {
        return Integer.MIN_VALUE+1;
    }

    @Override
    public boolean dealReq(HttpServletRequest req) {
        log.info("实现限流检测的slot");
        // TODO 实现限流逻辑
        return true;
    }
}
